package com.example.shiwu;

import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewStub;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import com.example.shiwu.db.model.BoxEight;
import com.example.shiwu.db.model.BoxFive;
import com.example.shiwu.db.model.BoxFour;
import com.example.shiwu.db.model.BoxNine;
import com.example.shiwu.db.model.BoxOne;
import com.example.shiwu.db.model.BoxSeven;
import com.example.shiwu.db.model.BoxSix;
import com.example.shiwu.db.model.BoxTen;
import com.example.shiwu.db.model.BoxThree;
import com.example.shiwu.db.model.BoxTwo;
import com.example.shiwu.db.model.Items;
import com.example.shiwu.service.BoxEightService;
import com.example.shiwu.service.BoxFiveService;
import com.example.shiwu.service.BoxFourService;
import com.example.shiwu.service.BoxNineService;
import com.example.shiwu.service.BoxOneService;
import com.example.shiwu.service.BoxSevenService;
import com.example.shiwu.service.BoxSixService;
import com.example.shiwu.service.BoxTenService;
import com.example.shiwu.service.BoxThreeService;
import com.example.shiwu.service.BoxTwoService;
import com.example.shiwu.service.ItemsService;
import com.example.shiwu.util.DateUtils;
import com.example.shiwu.util.LocationNewUtils;
import com.github.dfqin.grantor.PermissionListener;
import com.github.dfqin.grantor.PermissionsUtil;

import java.util.List;

public class GpsDetailsActivity extends AppCompatActivity {


    public ListView editSb;
    public TextView title_text, title_seting, did,
            box_one_val,box_two_val, box_three_val, box_four_val, box_five_val, box_six_val, box_seven_val, box_eight_val, box_nine_val, box_ten_val, box_eleven_val, box_twelve_val,
            boxtwo_one_val, boxtwo_two_val, boxtwo_three_val, boxtwo_four_val, boxtwo_five_val, boxtwo_six_val, boxtwo_seven_val, boxtwo_eight_val, boxtwo_nine_val, boxtwo_ten_val, boxtwo_eleven_val, boxtwo_twelve_val,
            boxthree_one_val, boxthree_two_val, boxthree_three_val, boxthree_four_val, boxthree_five_val, boxthree_six_val, boxthree_seven_val, boxthree_eight_val, boxthree_nine_val, boxthree_ten_val, boxthree_eleven_val, boxthree_twelve_val,
            boxfour_one_val, boxfour_two_val, boxfour_three_val, boxfour_four_val, boxfour_five_val, boxfour_six_val, boxfour_seven_val, boxfour_eight_val, boxfour_nine_val, boxfour_ten_val, boxfour_eleven_val, boxfour_twelve_val,
            boxfive_one_val, boxfive_two_val, boxfive_three_val, boxfive_four_val, boxfive_five_val, boxfive_six_val, boxfive_seven_val, boxfive_eight_val, boxfive_nine_val, boxfive_ten_val, boxfive_eleven_val, boxfive_twelve_val,
            boxsix_one_val, boxsix_two_val, boxsix_three_val, boxsix_four_val, boxsix_five_val, boxsix_six_val, boxsix_seven_val, boxsix_eight_val, boxsix_nine_val, boxsix_ten_val, boxsix_eleven_val, boxsix_twelve_val,
            boxseven_one_val, boxseven_two_val, boxseven_three_val, boxseven_four_val, boxseven_five_val, boxseven_six_val, boxseven_seven_val, boxseven_eight_val, boxseven_nine_val, boxseven_ten_val, boxseven_eleven_val, boxseven_twelve_val,
            boxeight_one_val, boxeight_two_val, boxeight_three_val, boxeight_four_val, boxeight_five_val, boxeight_six_val, boxeight_seven_val, boxeight_eight_val, boxeight_nine_val, boxeight_ten_val, boxeight_eleven_val, boxeight_twelve_val,
            boxnine_one_val, boxnine_two_val, boxnine_three_val, boxnine_four_val, boxnine_five_val, boxnine_six_val, boxnine_seven_val, boxnine_eight_val, boxnine_nine_val, boxnine_ten_val, boxnine_eleven_val, boxnine_twelve_val,
            boxten_one_val, boxten_two_val, boxten_three_val, boxten_four_val, boxten_five_val, boxten_six_val, boxten_seven_val, boxten_eight_val, boxten_nine_val, boxten_ten_val, boxten_eleven_val, boxten_twelve_val;
    private Button bt_box_one,bt_box_two,bt_box_three,bt_box_four,bt_box_five,bt_box_six,bt_box_seven,bt_box_eight,bt_box_nine,bt_box_ten,bt_box_eleven,bt_box_twelve;

    private Context myContent;
    private ViewStub viewStub1, viewStub2, viewStub3;
    public LocationNewUtils locationNewUtils;
    private TextView tv_show_foucs;
    private BoxOneService boxOneService;
    private BoxTwoService boxTwoService;
    private BoxThreeService boxThreeService;
    private BoxFourService boxFourService;
    private BoxFiveService boxFiveService;
    private BoxSixService boxSixService;
    private BoxSevenService boxSevenService;
    private BoxEightService boxEightService;
    private BoxNineService boxNineService;
    private BoxTenService boxTenService;
    private ItemsService itemsService;
    Items items = null;
    public ImageView title_back;
    //申请的权限
    private static final String[] mPermissions = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION};

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.gps_details_item);
        initbefore9box();
        initService();
        btInit();
        itemsService = new ItemsService();
        items = findSelectItem();
        //增加XML样式控件布局
        final LayoutInflater inflater = LayoutInflater.from(this);
        final LinearLayout scrollView = findViewById(R.id.box_add_child);
        Handler mhandler = new Handler();
        mhandler.postDelayed(new Runnable() {
            @Override
            public void run() {
                //插入的布局
                @SuppressLint("ResourceType")
                LinearLayout layout2 = (LinearLayout) inflater.inflate(R.layout.gps_add_item_item, null).findViewById(R.id.box_add_item);
                scrollView.addView(layout2);
                initbehind3box();
                btLowInit();
            }
        }, 10);

        myContent = this;
        title_back = findViewById(R.id.title_back);
        title_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                GpsDetailsActivity.this.finish();
            }
        });
        Intent intent = getIntent();
        String itemId = intent.getStringExtra("id");
        if(!itemId.equals("")){
            initDataTextView(itemId);
        }
    }

    private void initDataTextView(String itemId){
        List<BoxOne> boxOneList= boxOneService.getBoxOne(new BoxOne(itemId));
        if(boxOneList.size()>0){
            BoxOne boxOne = boxOneList.get(0);
            saveBoxOne(boxOne);
        }

        List<BoxTwo> boxTwoList=boxTwoService.getBoxTwo(new BoxTwo(itemId));
        if(boxTwoList.size()>0){
            BoxTwo boxTwo = boxTwoList.get(0);
            saveBoxTwo(boxTwo);
        }
        List<BoxThree> boxThreeList = boxThreeService.getBoxThree(new BoxThree(itemId));
        if(boxThreeList.size()>0){
            BoxThree boxThree = boxThreeList.get(0);
            saveBoxThree(boxThree);
        }
        List<BoxFour> boxFourList = boxFourService.getBoxFour(new BoxFour(itemId));
        if(boxFourList.size()>0){
            BoxFour boxFour = boxFourList.get(0);
            saveBoxFour(boxFour);
        }
        List<BoxFive> boxFiveList = boxFiveService.getBoxFive(new BoxFive(itemId));
        if(boxFiveList.size()>0){
            BoxFive boxFive = boxFiveList.get(0);
            saveBoxFive(boxFive);
        }
        List<BoxSix> boxSixList = boxSixService.getBoxSix(new BoxSix(itemId));
        if(boxSixList.size()>0){
            BoxSix boxSix = boxSixList.get(0);
            saveBoxSix(boxSix);
        }
        List<BoxSeven> boxSevenList = boxSevenService.getBoxSeven(new BoxSeven(itemId));
        if(boxSevenList.size()>0){
            BoxSeven boxSeven = boxSevenList.get(0);
            saveBoxSeven(boxSeven);
        }
        List<BoxEight> boxEightList = boxEightService.getBoxEight(new BoxEight(itemId));
        if(boxEightList.size()>0){
            BoxEight boxEight = boxEightList.get(0);
            saveBoxEight(boxEight);
        }
        List<BoxNine> boxNineList = boxNineService.getBoxNine(new BoxNine(itemId));
        if(boxNineList.size()>0){
            BoxNine boxNine = boxNineList.get(0);
            saveBoxNine(boxNine);
        }
        List<BoxTen> boxTenList = boxTenService.getBoxTen(new BoxTen(itemId));
        if(boxTenList.size()>0){
            BoxTen boxTen = boxTenList.get(0);
            saveBoxTen(boxTen);
        }
    }



    /**
     * 请求权限
     */
    private void requestPermissions() {
        if (PermissionsUtil.hasPermission(GpsDetailsActivity.this, mPermissions)) {
            //有访问权限
            initLocation();
        } else {
            PermissionsUtil.requestPermission(this, new PermissionListener() {
                @Override
                public void permissionGranted(@NonNull String[] permissions) {
                    //用户授予了访问权限
                    initLocation();
                }

                @Override
                public void permissionDenied(@NonNull String[] permissions) {
                    //用户拒绝了访问的申请
                    // initLocation();
                }
            }, mPermissions);
        }
    }

    /**
     * 加载位置
     */
    private void initLocation() {
        locationNewUtils.setAddressCallback(new LocationNewUtils.AddressCallback() {
            @Override
            public void onGetLocation(double lat, double lng) {
                tv_show_foucs.setText(lat + " - " + lng);
                locationNewUtils.cleareAddressCallback();
            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //locationNewUtils.cleareAddressCallback();
    }
    private Items findSelectItem(){
        itemsService = new ItemsService();
        Items items = new Items();
        Items items1 = new Items();
        items.setStatus(1);
        List<Items> lis = null;

        try {
            lis = itemsService.getItems(items);
            items1 = lis.get(0);
        }catch (Exception e){
            e.printStackTrace();
        }
        return items1;
    }
    private void initService(){
        boxOneService = new BoxOneService();
        boxTwoService = new BoxTwoService();
        boxThreeService = new BoxThreeService();
        boxFourService = new BoxFourService();
        boxFiveService = new BoxFiveService();
        boxSixService = new BoxSixService();
        boxSevenService = new BoxSevenService();
        boxEightService = new BoxEightService();
        boxNineService = new BoxNineService();
        boxTenService = new BoxTenService();
    }

    private void btInit(){
        bt_box_one = findViewById(R.id.bt_box_one);
        bt_box_two = findViewById(R.id.bt_box_two);
        bt_box_three= findViewById(R.id.bt_box_three);
        bt_box_four = findViewById(R.id.bt_box_four);
        bt_box_five= findViewById(R.id.bt_box_five);
        bt_box_six = findViewById(R.id.bt_box_six);
        bt_box_seven = findViewById(R.id.bt_box_seven);
        bt_box_eight = findViewById(R.id.bt_box_eight);
        bt_box_nine= findViewById(R.id.bt_box_nine);

    }

    private void btLowInit(){
        bt_box_ten = findViewById(R.id.bt_box_ten);

    }
    private void saveBoxOne(BoxOne boxOne){
        box_one_val.setText(boxOne.getBoxOneLat());
        box_two_val.setText(boxOne.getBoxTwoLat());
        box_three_val.setText(boxOne.getBoxThreeLat());
        box_four_val.setText(boxOne.boxFourLat);
        box_five_val.setText(boxOne.getBoxFiveLat());
        box_six_val.setText(boxOne.getBoxSixLat());
        box_seven_val.setText(boxOne.getBoxSevenLat());
        box_eight_val.setText(boxOne.getBoxEightLat());
        box_nine_val.setText(boxOne.getBoxNineLat());
        box_ten_val.setText(boxOne.boxTenLat);
        box_eleven_val.setText(boxOne.getBoxElevenLat());
        box_twelve_val.setText(boxOne.getBoxTwelveLat());
    }
    private void saveBoxTwo(BoxTwo boxTwo){
        boxtwo_one_val.setText(boxTwo.getBoxOneLat());
        boxtwo_two_val.setText(boxTwo.getBoxTwoLat());
        boxtwo_three_val.setText(boxTwo.getBoxThreeLat());
        boxtwo_four_val.setText(boxTwo.getBoxFourLat());
        boxtwo_five_val.setText(boxTwo.getBoxFiveLat());
        boxtwo_six_val.setText(boxTwo.getBoxSixLat());
        boxtwo_seven_val.setText(boxTwo.getBoxSevenLat());
        boxtwo_eight_val.setText(boxTwo.getBoxEightLat());
        boxtwo_nine_val.setText(boxTwo.getBoxNineLat());
        boxtwo_ten_val.setText(boxTwo.getBoxTenLat());
        boxtwo_eleven_val.setText(boxTwo.getBoxElevenLat());
        boxtwo_twelve_val.setText(boxTwo.getBoxTwelveLat());
    }
    private void saveBoxThree(BoxThree boxThree){
        boxthree_one_val.setText(boxThree.getBoxOneLat());
        boxthree_two_val.setText(boxThree.getBoxTwoLat());
        boxthree_three_val.setText(boxThree.getBoxThreeLat());
        boxthree_four_val.setText(boxThree.getBoxFourLat());
        boxthree_five_val.setText(boxThree.getBoxFiveLat());
        boxthree_six_val.setText(boxThree.getBoxSixLat());
        boxthree_seven_val.setText(boxThree.getBoxSevenLat());
        boxthree_eight_val.setText(boxThree.getBoxEightLat());
        boxthree_nine_val.setText(boxThree.getBoxNineLat());
        boxthree_ten_val.setText(boxThree.getBoxTenLat());
        boxthree_eleven_val.setText(boxThree.getBoxElevenLat());
        boxthree_twelve_val.setText(boxThree.getBoxTwelveLat());

    }
    private void saveBoxFour(BoxFour boxFour){
        boxfour_one_val.setText(boxFour.getBoxOneLat());
        boxfour_two_val.setText(boxFour.getBoxTwoLat());
        boxfour_three_val.setText(boxFour.getBoxThreeLat());
        boxfour_four_val.setText(boxFour.getBoxFourLat());
        boxfour_five_val.setText(boxFour.getBoxFiveLat());
        boxfour_six_val.setText(boxFour.getBoxSixLat());
        boxfour_seven_val.setText(boxFour.getBoxSevenLat());
        boxfour_eight_val.setText(boxFour.getBoxEightLat());
        boxfour_nine_val.setText(boxFour.getBoxNineLat());
        boxfour_ten_val.setText(boxFour.getBoxTenLat());
        boxfour_eleven_val.setText(boxFour.getBoxElevenLat());
        boxfour_twelve_val.setText(boxFour.getBoxTwelveLat());
    }
    private void saveBoxFive(BoxFive boxFive){
        boxfive_one_val.setText(boxFive.getBoxOneLat());
        boxfive_two_val.setText(boxFive.getBoxTwoLat());
        boxfive_three_val.setText(boxFive.getBoxThreeLat());
        boxfive_four_val.setText(boxFive.getBoxFourLat());
        boxfive_five_val.setText(boxFive.getBoxFiveLat());
        boxfive_six_val.setText(boxFive.getBoxSixLat());
        boxfive_seven_val.setText(boxFive.getBoxSevenLat());
        boxfive_eight_val.setText(boxFive.getBoxEightLat());
        boxfive_nine_val.setText(boxFive.getBoxNineLat());
        boxfive_ten_val.setText(boxFive.getBoxTenLat());
        boxfive_eleven_val.setText(boxFive.getBoxElevenLat());
        boxfive_twelve_val.setText(boxFive.getBoxTwelveLat());
    }
    private void saveBoxSix(BoxSix boxSix){
        boxsix_one_val.setText(boxSix.getBoxOneLat());
        boxsix_two_val.setText(boxSix.getBoxTwoLat());
        boxsix_three_val.setText(boxSix.getBoxThreeLat());
        boxsix_four_val.setText(boxSix.getBoxFourLat());
        boxsix_five_val.setText(boxSix.getBoxFiveLat());
        boxsix_six_val.setText(boxSix.getBoxSixLat());
        boxsix_seven_val.setText(boxSix.getBoxSevenLat());
        boxsix_eight_val.setText(boxSix.getBoxEightLat());
        boxsix_nine_val.setText(boxSix.getBoxNineLat());
        boxsix_ten_val.setText(boxSix.getBoxTenLat());
        boxsix_eleven_val.setText(boxSix.getBoxElevenLat());
        boxsix_twelve_val.setText(boxSix.getBoxTwelveLat());
    }
    private void saveBoxSeven(BoxSeven boxSeven){
        boxseven_one_val.setText(boxSeven.getBoxOneLat());
        boxseven_two_val.setText(boxSeven.getBoxTwoLat());
        boxseven_three_val.setText(boxSeven.getBoxThreeLat());
        boxseven_four_val.setText(boxSeven.getBoxFourLat());
        boxseven_five_val.setText(boxSeven.getBoxFiveLat());
        boxseven_six_val.setText(boxSeven.getBoxSixLat());
        boxseven_seven_val.setText(boxSeven.getBoxSevenLat());
        boxseven_eight_val.setText(boxSeven.getBoxEightLat());
        boxseven_nine_val.setText(boxSeven.getBoxNineLat());
        boxseven_ten_val.setText(boxSeven.getBoxTenLat());
        boxseven_eleven_val.setText(boxSeven.getBoxElevenLat());
        boxseven_twelve_val.setText(boxSeven.getBoxTwelveLat());
    }
    private void saveBoxEight(BoxEight boxEight){
        boxeight_one_val.setText(boxEight.getBoxOneLat());
        boxeight_two_val.setText(boxEight.getBoxTwoLat());
        boxeight_three_val.setText(boxEight.getBoxThreeLat());
        boxeight_four_val.setText(boxEight.getBoxFourLat());
        boxeight_five_val.setText(boxEight.getBoxFiveLat());
        boxeight_six_val.setText(boxEight.getBoxSixLat());
        boxeight_seven_val.setText(boxEight.getBoxSevenLat());
        boxeight_eight_val.setText(boxEight.getBoxEightLat());
        boxeight_nine_val.setText(boxEight.getBoxNineLat());
        boxeight_ten_val.setText(boxEight.getBoxTenLat());
        boxeight_eleven_val.setText(boxEight.getBoxElevenLat());
        boxeight_twelve_val.setText(boxEight.getBoxTwelveLat());
    }
    private void saveBoxNine(BoxNine boxNine){
        boxnine_one_val.setText(boxNine.getBoxOneLat());
        boxnine_two_val.setText(boxNine.getBoxTwoLat());
        boxnine_three_val.setText(boxNine.getBoxThreeLat());
        boxnine_four_val.setText(boxNine.getBoxFourLat());
        boxnine_five_val.setText(boxNine.getBoxFiveLat());
        boxnine_six_val.setText(boxNine.getBoxSixLat());
        boxnine_seven_val.setText(boxNine.getBoxSevenLat());
        boxnine_eight_val.setText(boxNine.getBoxEightLat());
        boxnine_nine_val.setText(boxNine.getBoxNineLat());
        boxnine_ten_val.setText(boxNine.getBoxTenLat());
        boxnine_eleven_val.setText(boxNine.getBoxElevenLat());
        boxnine_twelve_val.setText(boxNine.getBoxTwelveLat());
    }
    private void saveBoxTen(BoxTen boxTen){
        box_one_val.setText(boxTen.getBoxOneLat());
        box_two_val.setText(boxTen.getBoxTwoLat());
        box_three_val.setText(boxTen.getBoxThreeLat());
        box_four_val.setText(boxTen.getBoxFourLat());
        box_five_val.setText(boxTen.getBoxFiveLat());
        box_six_val.setText(boxTen.getBoxSixLat());
        box_seven_val.setText(boxTen.getBoxSevenLat());
        box_eight_val.setText(boxTen.getBoxEightLat());
        box_nine_val.setText(boxTen.getBoxNineLat());
        box_ten_val.setText(boxTen.getBoxTenLat());
        box_eleven_val.setText(boxTen.getBoxElevenLat());
        box_twelve_val.setText(boxTen.getBoxTwelveLat());
    }

    private void initbefore9box() {
        //------------------------box1----------------------
        box_one_val = findViewById(R.id.box_one_val);
        box_two_val = findViewById(R.id.box_two_val);
        box_three_val = findViewById(R.id.box_three_val);
        box_four_val = findViewById(R.id.box_four_val);
        box_five_val = findViewById(R.id.box_five_val);
        box_six_val = findViewById(R.id.box_six_val);
        box_seven_val = findViewById(R.id.box_seven_val);
        box_eight_val = findViewById(R.id.box_eight_val);
        box_nine_val = findViewById(R.id.box_nine_val);
        box_ten_val = findViewById(R.id.box_ten_val);
        box_eleven_val = findViewById(R.id.box_eleven_val);
        box_twelve_val = findViewById(R.id.box_twelve_val);
        //------------------------box2----------------------
        boxtwo_one_val = findViewById(R.id.boxtwo_one_val);
        boxtwo_two_val = findViewById(R.id.boxtwo_two_val);
        boxtwo_three_val = findViewById(R.id.boxtwo_three_val);
        boxtwo_four_val = findViewById(R.id.boxtwo_four_val);
        boxtwo_five_val = findViewById(R.id.boxtwo_five_val);
        boxtwo_six_val = findViewById(R.id.boxtwo_six_val);
        boxtwo_seven_val = findViewById(R.id.boxtwo_seven_val);
        boxtwo_eight_val = findViewById(R.id.boxtwo_eight_val);
        boxtwo_nine_val = findViewById(R.id.boxtwo_nine_val);
        boxtwo_ten_val = findViewById(R.id.boxtwo_ten_val);
        boxtwo_eleven_val = findViewById(R.id.boxtwo_eleven_val);
        boxtwo_twelve_val = findViewById(R.id.boxtwo_twelve_val);
        //------------------------box3----------------------
        boxthree_one_val = findViewById(R.id.boxthree_one_val);
        boxthree_two_val = findViewById(R.id.boxthree_two_val);
        boxthree_three_val = findViewById(R.id.boxthree_three_val);
        boxthree_four_val = findViewById(R.id.boxthree_four_val);
        boxthree_five_val = findViewById(R.id.boxthree_five_val);
        boxthree_six_val = findViewById(R.id.boxthree_six_val);
        boxthree_seven_val = findViewById(R.id.boxthree_seven_val);
        boxthree_eight_val = findViewById(R.id.boxthree_eight_val);
        boxthree_nine_val = findViewById(R.id.boxthree_nine_val);
        boxthree_ten_val = findViewById(R.id.boxthree_ten_val);
        boxthree_eleven_val = findViewById(R.id.boxthree_eleven_val);
        boxthree_twelve_val = findViewById(R.id.boxthree_twelve_val);
        //------------------------box4----------------------
        boxfour_one_val = findViewById(R.id.boxfour_one_val);
        boxfour_two_val = findViewById(R.id.boxfour_two_val);
        boxfour_three_val = findViewById(R.id.boxfour_three_val);
        boxfour_four_val = findViewById(R.id.boxfour_four_val);
        boxfour_five_val = findViewById(R.id.boxfour_five_val);
        boxfour_six_val = findViewById(R.id.boxfour_six_val);
        boxfour_seven_val = findViewById(R.id.boxfour_seven_val);
        boxfour_eight_val = findViewById(R.id.boxfour_eight_val);
        boxfour_nine_val = findViewById(R.id.boxfour_nine_val);
        boxfour_ten_val = findViewById(R.id.boxfour_ten_val);
        boxfour_eleven_val = findViewById(R.id.boxfour_eleven_val);
        boxfour_twelve_val = findViewById(R.id.boxfour_twelve_val);
        //------------------------box5----------------------
        boxfive_one_val = findViewById(R.id.boxfive_one_val);
        boxfive_two_val = findViewById(R.id.boxfive_two_val);
        boxfive_three_val = findViewById(R.id.boxfive_three_val);
        boxfive_four_val = findViewById(R.id.boxfive_four_val);
        boxfive_five_val = findViewById(R.id.boxfive_five_val);
        boxfive_six_val = findViewById(R.id.boxfive_six_val);
        boxfive_seven_val = findViewById(R.id.boxfive_seven_val);
        boxfive_eight_val = findViewById(R.id.boxfive_eight_val);
        boxfive_nine_val = findViewById(R.id.boxfive_nine_val);
        boxfive_ten_val = findViewById(R.id.boxfive_ten_val);
        boxfive_eleven_val = findViewById(R.id.boxfive_eleven_val);
        boxfive_twelve_val = findViewById(R.id.boxfive_twelve_val);
        //------------------------box6----------------------
        boxsix_one_val = findViewById(R.id.boxsix_one_val);
        boxsix_two_val = findViewById(R.id.boxsix_two_val);
        boxsix_three_val = findViewById(R.id.boxsix_three_val);
        boxsix_four_val = findViewById(R.id.boxsix_four_val);
        boxsix_five_val = findViewById(R.id.boxsix_five_val);
        boxsix_six_val = findViewById(R.id.boxsix_six_val);
        boxsix_seven_val = findViewById(R.id.boxsix_seven_val);
        boxsix_eight_val = findViewById(R.id.boxsix_eight_val);
        boxsix_nine_val = findViewById(R.id.boxsix_nine_val);
        boxsix_ten_val = findViewById(R.id.boxsix_ten_val);
        boxsix_eleven_val = findViewById(R.id.boxsix_eleven_val);
        boxsix_twelve_val = findViewById(R.id.boxsix_twelve_val);
        //------------------------box7----------------------
        boxseven_one_val = findViewById(R.id.boxseven_one_val);
        boxseven_two_val = findViewById(R.id.boxseven_two_val);
        boxseven_three_val = findViewById(R.id.boxseven_three_val);
        boxseven_four_val = findViewById(R.id.boxseven_four_val);
        boxseven_five_val = findViewById(R.id.boxseven_five_val);
        boxseven_six_val = findViewById(R.id.boxseven_six_val);
        boxseven_seven_val = findViewById(R.id.boxseven_seven_val);
        boxseven_eight_val = findViewById(R.id.boxseven_eight_val);
        boxseven_nine_val = findViewById(R.id.boxseven_nine_val);
        boxseven_ten_val = findViewById(R.id.boxseven_ten_val);
        boxseven_eleven_val = findViewById(R.id.boxseven_eleven_val);
        boxseven_twelve_val = findViewById(R.id.boxseven_twelve_val);
        //------------------------box8----------------------
        boxeight_one_val = findViewById(R.id.boxeight_one_val);
        boxeight_two_val = findViewById(R.id.boxeight_two_val);
        boxeight_three_val = findViewById(R.id.boxeight_three_val);
        boxeight_four_val = findViewById(R.id.boxeight_four_val);
        boxeight_five_val = findViewById(R.id.boxeight_five_val);
        boxeight_six_val = findViewById(R.id.boxeight_six_val);
        boxeight_seven_val = findViewById(R.id.boxeight_seven_val);
        boxeight_eight_val = findViewById(R.id.boxeight_eight_val);
        boxeight_nine_val = findViewById(R.id.boxeight_nine_val);
        boxeight_ten_val = findViewById(R.id.boxeight_ten_val);
        boxeight_eleven_val = findViewById(R.id.boxeight_eleven_val);
        boxeight_twelve_val = findViewById(R.id.boxeight_twelve_val);
        //------------------------box9----------------------
        boxnine_one_val = findViewById(R.id.boxnine_one_val);
        boxnine_two_val = findViewById(R.id.boxnine_two_val);
        boxnine_three_val = findViewById(R.id.boxnine_three_val);
        boxnine_four_val = findViewById(R.id.boxnine_four_val);
        boxnine_five_val = findViewById(R.id.boxnine_five_val);
        boxnine_six_val = findViewById(R.id.boxnine_six_val);
        boxnine_seven_val = findViewById(R.id.boxnine_seven_val);
        boxnine_eight_val = findViewById(R.id.boxnine_eight_val);
        boxnine_nine_val = findViewById(R.id.boxnine_nine_val);
        boxnine_ten_val = findViewById(R.id.boxnine_ten_val);
        boxnine_eleven_val = findViewById(R.id.boxnine_eleven_val);
        boxnine_twelve_val = findViewById(R.id.boxnine_twelve_val);

        // -----------------------------box1-----------------------
        box_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = box_one_val;
                requestPermissions();
            }
        });

        box_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = box_two_val;
                requestPermissions();
            }
        });

        box_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = box_three_val;
                requestPermissions();
            }
        });

        box_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = box_four_val;
                requestPermissions();
            }
        });

        box_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = box_five_val;
                requestPermissions();
            }
        });

        box_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = box_six_val;
                requestPermissions();
            }
        });

        box_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = box_seven_val;
                requestPermissions();
            }
        });

        box_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = box_eight_val;
                requestPermissions();
            }
        });

        box_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = box_nine_val;
                requestPermissions();
            }
        });

        box_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = box_ten_val;
                requestPermissions();
            }
        });

        box_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = box_eleven_val;
                requestPermissions();
            }
        });

        box_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = box_twelve_val;
                requestPermissions();
            }
        });

        // -----------------------------box2-----------------------
        boxtwo_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxtwo_one_val;
                requestPermissions();
            }
        });

        boxtwo_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxtwo_two_val;
                requestPermissions();
            }
        });

        boxtwo_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxtwo_three_val;
                requestPermissions();
            }
        });

        boxtwo_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxtwo_four_val;
                requestPermissions();
            }
        });

        boxtwo_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxtwo_five_val;
                requestPermissions();
            }
        });

        boxtwo_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxtwo_six_val;
                requestPermissions();
            }
        });

        boxtwo_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxtwo_seven_val;
                requestPermissions();
            }
        });

        boxtwo_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxtwo_eight_val;
                requestPermissions();
            }
        });

        boxtwo_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxtwo_nine_val;
                requestPermissions();
            }
        });

        boxtwo_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxtwo_ten_val;
                requestPermissions();
            }
        });

        boxtwo_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxtwo_eleven_val;
                requestPermissions();
            }
        });

        boxtwo_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxtwo_twelve_val;
                requestPermissions();
            }
        });


        // -----------------------------box3-----------------------
        boxthree_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxthree_one_val;
                requestPermissions();
            }
        });

        boxthree_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxthree_two_val;
                requestPermissions();
            }
        });

        boxthree_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxthree_three_val;
                requestPermissions();
            }
        });

        boxthree_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxthree_four_val;
                requestPermissions();
            }
        });

        boxthree_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxthree_five_val;
                requestPermissions();
            }
        });

        boxthree_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxthree_six_val;
                requestPermissions();
            }
        });

        boxthree_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxthree_seven_val;
                requestPermissions();
            }
        });

        boxthree_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxthree_eight_val;
                requestPermissions();
            }
        });

        boxthree_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxthree_nine_val;
                requestPermissions();
            }
        });

        boxthree_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxthree_ten_val;
                requestPermissions();
            }
        });

        boxthree_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxthree_eleven_val;
                requestPermissions();
            }
        });

        boxthree_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxthree_twelve_val;
                requestPermissions();
            }
        });

        // -----------------------------box4-----------------------
        boxfour_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfour_one_val;
                requestPermissions();
            }
        });

        boxfour_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfour_two_val;
                requestPermissions();
            }
        });

        boxfour_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfour_three_val;
                requestPermissions();
            }
        });

        boxfour_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfour_four_val;
                requestPermissions();
            }
        });

        boxfour_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfour_five_val;
                requestPermissions();
            }
        });

        boxfour_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfour_six_val;
                requestPermissions();
            }
        });

        boxfour_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfour_seven_val;
                requestPermissions();
            }
        });

        boxfour_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfour_eight_val;
                requestPermissions();
            }
        });

        boxfour_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfour_nine_val;
                requestPermissions();
            }
        });

        boxfour_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfour_ten_val;
                requestPermissions();
            }
        });

        boxfour_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfour_eleven_val;
                requestPermissions();
            }
        });

        boxfour_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfour_twelve_val;
                requestPermissions();
            }
        });
        // -----------------------------box5-----------------------
        boxfive_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfive_one_val;
                requestPermissions();
            }
        });

        boxfive_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfive_two_val;
                requestPermissions();
            }
        });

        boxfive_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfive_three_val;
                requestPermissions();
            }
        });

        boxfive_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfive_four_val;
                requestPermissions();
            }
        });

        boxfive_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfive_five_val;
                requestPermissions();
            }
        });

        boxfive_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfive_six_val;
                requestPermissions();
            }
        });

        boxfive_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfive_seven_val;
                requestPermissions();
            }
        });

        boxfive_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfive_eight_val;
                requestPermissions();
            }
        });

        boxfive_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfive_nine_val;
                requestPermissions();
            }
        });

        boxfive_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfive_ten_val;
                requestPermissions();
            }
        });

        boxfive_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfive_eleven_val;
                requestPermissions();
            }
        });

        boxfive_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxfive_twelve_val;
                requestPermissions();
            }
        });
        // -----------------------------box6-----------------------
        boxsix_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxsix_one_val;
                requestPermissions();
            }
        });

        boxsix_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxsix_two_val;
                requestPermissions();
            }
        });

        boxsix_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxsix_three_val;
                requestPermissions();
            }
        });

        boxsix_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxsix_four_val;
                requestPermissions();
            }
        });

        boxsix_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxsix_five_val;
                requestPermissions();
            }
        });

        boxsix_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxsix_six_val;
                requestPermissions();
            }
        });

        boxsix_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxsix_seven_val;
                requestPermissions();
            }
        });

        boxsix_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxsix_eight_val;
                requestPermissions();
            }
        });

        boxsix_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxsix_nine_val;
                requestPermissions();
            }
        });

        boxsix_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxsix_ten_val;
                requestPermissions();
            }
        });

        boxsix_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxsix_eleven_val;
                requestPermissions();
            }
        });

        boxsix_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxsix_twelve_val;
                requestPermissions();
            }
        });
        // -----------------------------box7-----------------------
        boxseven_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxseven_one_val;
                requestPermissions();
            }
        });

        boxseven_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxseven_two_val;
                requestPermissions();
            }
        });

        boxseven_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxseven_three_val;
                requestPermissions();
            }
        });

        boxseven_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxseven_four_val;
                requestPermissions();
            }
        });

        boxseven_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxseven_five_val;
                requestPermissions();
            }
        });

        boxseven_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxseven_six_val;
                requestPermissions();
            }
        });

        boxseven_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxseven_seven_val;
                requestPermissions();
            }
        });

        boxseven_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxseven_eight_val;
                requestPermissions();
            }
        });

        boxseven_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxseven_nine_val;
                requestPermissions();
            }
        });

        boxseven_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxseven_ten_val;
                requestPermissions();
            }
        });

        boxseven_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxseven_eleven_val;
                requestPermissions();
            }
        });

        boxseven_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxseven_twelve_val;
                requestPermissions();
            }
        });
        // -----------------------------box6-----------------------
        boxeight_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxeight_one_val;
                requestPermissions();
            }
        });

        boxeight_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxeight_two_val;
                requestPermissions();
            }
        });

        boxeight_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxeight_three_val;
                requestPermissions();
            }
        });

        boxeight_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxeight_four_val;
                requestPermissions();
            }
        });

        boxeight_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxeight_five_val;
                requestPermissions();
            }
        });

        boxeight_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxeight_six_val;
                requestPermissions();
            }
        });

        boxeight_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxeight_seven_val;
                requestPermissions();
            }
        });

        boxeight_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxeight_eight_val;
                requestPermissions();
            }
        });

        boxeight_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxeight_nine_val;
                requestPermissions();
            }
        });

        boxeight_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxeight_ten_val;
                requestPermissions();
            }
        });

        boxeight_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxeight_eleven_val;
                requestPermissions();
            }
        });

        boxeight_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxeight_twelve_val;
                requestPermissions();
            }
        });
        // -----------------------------box6-----------------------
        boxnine_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxnine_one_val;
                requestPermissions();
            }
        });

        boxnine_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxnine_two_val;
                requestPermissions();
            }
        });

        boxnine_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxnine_three_val;
                requestPermissions();
            }
        });

        boxnine_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxnine_four_val;
                requestPermissions();
            }
        });

        boxnine_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxnine_five_val;
                requestPermissions();
            }
        });

        boxnine_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxnine_six_val;
                requestPermissions();
            }
        });

        boxnine_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxnine_seven_val;
                requestPermissions();
            }
        });

        boxnine_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxnine_eight_val;
                requestPermissions();
            }
        });

        boxnine_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxnine_nine_val;
                requestPermissions();
            }
        });

        boxnine_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxnine_ten_val;
                requestPermissions();
            }
        });

        boxnine_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxnine_eleven_val;
                requestPermissions();
            }
        });

        boxnine_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxnine_twelve_val;
                requestPermissions();
            }
        });

    }

    private void initbehind3box() {
        boxten_one_val = findViewById(R.id.boxten_one_val);
        boxten_two_val = findViewById(R.id.boxten_two_val);
        boxten_three_val = findViewById(R.id.boxten_three_val);
        boxten_four_val = findViewById(R.id.boxten_four_val);
        boxten_five_val = findViewById(R.id.boxten_five_val);
        boxten_six_val = findViewById(R.id.boxten_six_val);
        boxten_seven_val = findViewById(R.id.boxten_seven_val);
        boxten_eight_val = findViewById(R.id.boxten_eight_val);
        boxten_nine_val = findViewById(R.id.boxten_nine_val);
        boxten_ten_val = findViewById(R.id.boxten_ten_val);
        boxten_eleven_val = findViewById(R.id.boxten_eleven_val);
        boxten_twelve_val = findViewById(R.id.boxten_twelve_val);

        boxten_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxten_one_val;
                requestPermissions();
            }
        });
        boxten_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxten_two_val;
                requestPermissions();
            }
        });
        boxten_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxten_three_val;
                requestPermissions();
            }
        });
        boxten_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxten_four_val;
                requestPermissions();
            }
        });
        boxten_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxten_five_val;
                requestPermissions();
            }
        });
        boxten_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxten_six_val;
                requestPermissions();
            }
        });
        boxten_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxten_seven_val;
                requestPermissions();
            }
        });
        boxten_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxten_eight_val;
                requestPermissions();
            }
        });
        boxten_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxten_nine_val;
                requestPermissions();
            }
        });
        boxten_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxten_ten_val;
                requestPermissions();
            }
        });
        boxten_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxten_eleven_val;
                requestPermissions();
            }
        });
        boxten_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsDetailsActivity.this);
                tv_show_foucs = boxten_twelve_val;
                requestPermissions();
            }
        });
    }
}